<?php
	session_start();
	extract($_REQUEST);
	require_once("includes/common.php");
	require_once("includes/constants.php");
	require_once("includes/database.php");
	if (insertGarment($g_name , $g_style ,$g_department, $g_description, $g_image_thumbnail, $g_image_closeup, $g_keywords, $g_price, $g_hours_to_make, $g_est_fabric_required) != 0) {		
		$confirmationMessage = "$g_name has been added into company records." ;
		getAllGarments(); //update Garment list in session 
		header( 'Location: confirmationPage.php?' . "confirmationMessage=" .$confirmationMessage) ;
	}
	else {
		$errorMessage = "There was been a problem adding $g_name.";
		header( 'Location: errorPage.php?' . "errorMessage=" . $errorMessage ) ;
	}	
?>
